

//
//  ZZHomeVC.m
//  新项目
//
//  Created by 刘耀宗 on 2016/12/19.
//  Copyright © 2016年 刘耀宗. All rights reserved.
//

#import "ZZHomeVC.h"
#import "JHChartHeader.h"
#define k_MainBoundsWidth [UIScreen mainScreen].bounds.size.width
#define k_MainBoundsHeight [UIScreen mainScreen].bounds.size.height
@interface ZZHomeVC ()
@property (nonatomic, strong) JHRingChart *ring;

@end

@implementation ZZHomeVC
-(JHRingChart *)ring
{
    if (_ring == nil) {
        _ring = [[JHRingChart alloc] initWithFrame:CGRectMake(0, 302, k_MainBoundsWidth, newheight-302-64-20)];
    }
    return _ring;

}

- (void)viewDidLoad {
    [super viewDidLoad];
    [self settitleView];
    [self showRingChartView];

}
-(void)settitleView
{
    UILabel *label=[[UILabel alloc] init];
    label.text=@"商家首页";
    label.textColor=[UIColor redColor];
    [label sizeToFit];
    label.frame=CGRectMake(newwidth/2-label.frame.size.width/2, 20, label.frame.size.width, label.frame.size.height);
    self.navigationItem.titleView=label;

}
//环状图
- (void)showRingChartView{
 
    /*        background color         */
    self.ring.backgroundColor = [UIColor whiteColor];
    /*        Data source array, only the incoming value, the corresponding ratio will be automatically calculated         */
    self.ring.valueDataArr = @[@"0",@"0",@"1"];
    /*         Width of ring graph        */
    self.ring.ringWidth = 35.0;
    /*        Fill color for each section of the ring diagram         */
    self.ring.fillColorArray = @[[UIColor colorWithRed:1.000 green:0.783 blue:0.371 alpha:1.000], [UIColor colorWithRed:1.000 green:0.562 blue:0.968 alpha:1.000],[UIColor colorWithRed:0.313 green:1.000 blue:0.983 alpha:1.000],[UIColor colorWithRed:0.560 green:1.000 blue:0.276 alpha:1.000],[UIColor colorWithRed:0.239 green:0.651 blue:0.170 alpha:1.000],[UIColor colorWithRed:0.239 green:0.651 blue:0.170 alpha:1.000]];
    /*        Start animation             */
    [self.ring showAnimation];
    [self.view addSubview:self.ring];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
